<?php

//echo "pase";
require_once 'jq-config2.php';
//require_once ('/Applications/MAMP/htdocs/HS/jqSuitePHP_4_1_2_2/jq-config.php');
// include the jqGrid Class

require_once ABSPATH."php/jqGrid.php";
// include the driver class
require_once ABSPATH."php/jqGridPdo.php";
// Connection to the server
$conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD);
// Tell the db that we use utf-8
$conn->query("SET NAMES utf8");


// Create the jqGrid instance
$grid = new jqGridRender($conn);
// Write the SQL Query

// Write the SQL Query

$grid->SelectCommand = "SELECT idFarmacologia,descFarmacologia,Presentaciones,Dosis,Composicion,Indicaciones FROM farmacologia" ;

$grid->table = 'farmacologia'; 
//echo $grid->SelectCommand ;
// Set the table to where you update the data
//$grid->table = 'paciente';
// Set output format to json
$grid->dataType = 'json';
// Let the grid create the model

$grid->setColModel();

$grid->setUrl("Grid/gridfarmacologia.php");

// Set the url from where we obtain the data
// Set the url from where we obtain the data
// Set some grid options
$grid->setGridOptions(array(
        "caption"=>"Farmacolog&iacute;a", 
        "width"=>1000,
        "height"=>150,  
    "rowNum"=>10,
    "rowList"=>array(10,20,30),
    "shrinkToFit"=>false,
    "sortname"=>"idFarmacologia"
));

// Set the table to where you add the data 

$grid->setColProperty('idFarmacologia', array("label"=>"ID", "width"=>50));
$grid->setColProperty('descFarmacologia', array("label"=>"Descripci&oacute;n", "width"=>200));
$grid->setColProperty('Presentaciones', array("label"=>"Presentaci&oacute;n", "width"=>120));
$grid->setColProperty('Dosis', array("label"=>"Dosis", "width"=>100));
$grid->setColProperty('Composicion', array("label"=>"Composici&oacute;n", "width"=>200));
$grid->setColProperty('Indicaciones', array("label"=>"Inicaciones", "width"=>300));

$grid->toolbarfilter = true; 
// Enable navigator

$grid->navigator = true;
// Enable only editing
//$grid->setNavOptions('navigator', array("excel"=>false,"add"=>false,"edit"=>false,"del"=>false,"view"=>false));

$grid->setNavOptions('navigator', array("excel"=>true,"add"=>true,"edit"=>true,"del"=>true,"view"=>true, "search"=>true));

// Enjoy
$grid->renderGrid('#gridfarmacologia','#pagerfarmacologia',true, null, null, true,true);
// we set the select for ship city 

//$grid->setSelect("ShipCity", "SELECT DISTINCT ShipCity, ShipCity AS CityName FROM orders ORDER BY 2", false, false, true, array(""=>"All"))

$conn = null;

?> 
 


